<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Linux | VanKa</title><script src="https://cdn.bootcss.com/valine/1.4.4/Valine.min.js"></script><link rel="stylesheet" href="/vcb/css/arknights.css"><link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/styles/atom-one-dark-reasonable.min.css"><style>@font-face {
 font-family: BenderLight;
 src: local('Bender'), url("/vcb/font/BenderLight.ttf");
}
@font-face {
 font-family: 'JetBrains Mono';
 src: local('JetBrains Mono'), url('/vcb/font/JetBrainsMono-Regular.woff2') format('woff2');
}</style><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/vcb/atom.xml" title="VanKa" type="application/atom+xml">
</head><body><header><nav><a href="/vcb/">Home</a><a href="/vcb/archives/">Archives</a></nav></header><main><article><div id="post-bg"><div id="post-title"><h1>Linux</h1><hr></div><div id="post-content"><h1 id="Linux"><a href="#Linux" class="headerlink" title="Linux"></a>Linux</h1><blockquote>
<p>linux 系统笔记本，后期拆分</p>
</blockquote>
<h2 id="命令符"><a href="#命令符" class="headerlink" title="命令符"></a>命令符</h2><h5 id="linux-常用命令符"><a href="#linux-常用命令符" class="headerlink" title="linux 常用命令符"></a>linux 常用命令符</h5><table>
<thead>
<tr>
<th>命令符</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>clear</td>
<td>清屏</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<h5 id="非常用命令符"><a href="#非常用命令符" class="headerlink" title="非常用命令符"></a>非常用命令符</h5><table>
<thead>
<tr>
<th>命令符</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>lsb_release -a</td>
<td>查看系统版本</td>
</tr>
<tr>
<td>uname -a</td>
<td>查看系统内核版本</td>
</tr>
</tbody></table>
<h5 id="文件操作"><a href="#文件操作" class="headerlink" title="文件操作"></a>文件操作</h5><h6 id="删除文件命令"><a href="#删除文件命令" class="headerlink" title="删除文件命令"></a>删除文件命令</h6><p><strong>rm(remove)</strong> </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">功能说明：删除文件或目录</span><br><span class="line">补充说明：执行rm指令可删除文件或目录，如欲删除目录必须加上参数”-r”，否则预设仅会删除文件。</span><br><span class="line">参　　数：</span><br><span class="line">　-d或–directory 　直接把欲删除的目录的硬连接数据删成0，删除该目录。</span><br><span class="line">　-f或–force 　强制删除文件或目录。</span><br><span class="line">　-i或–interactive 　删除既有文件或目录之前先询问用户。</span><br><span class="line">　-r或-R或–recursive 　递归处理，将指定目录下的所有文件及子目录一并处理。</span><br><span class="line">　-v或–verbose 　显示指令执行过程。</span><br></pre></td></tr></table></figure>

<ol>
<li> 删除文件夹</li>
</ol>
   <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rm -rf fileNamede</span><br></pre></td></tr></table></figure>

<ol start="2">
<li><p>删除文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rm -f fileNamede</span><br></pre></td></tr></table></figure></li>
</ol>
<h6 id="添加文件夹命令"><a href="#添加文件夹命令" class="headerlink" title="添加文件夹命令"></a>添加文件夹命令</h6><p> <strong>mkdir(make directories)</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">功能说明：建立目录</span><br><span class="line">语　　法：mkdir [-p][--help][--version][-m &lt;目录属性&gt;][目录名称]</span><br><span class="line">补充说明：mkdir可建立目录并同时设置目录的权限。</span><br><span class="line">参　　数：</span><br><span class="line">    -m&lt;目录属性&gt;或–mode&lt;目录属性&gt; 建立目录时同时设置目录的权限。</span><br><span class="line">    -p或–parents 若所要建立目录的上层目录目前尚未建立，则会一并建立上层目录。</span><br></pre></td></tr></table></figure>

<p>例：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mkdir test</span><br></pre></td></tr></table></figure>



<h6 id="创建文件命令"><a href="#创建文件命令" class="headerlink" title="创建文件命令"></a>创建文件命令</h6><p><strong>touch</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">功能说明：改变文件或目录时间。</span><br><span class="line">语　　法：touch [-acfm][-d &lt;日期时间&gt;][-r &lt;参考文件或目 录&gt;][-t &lt;日期时间&gt;] [--help]　　 [--version][文件或目录...] 或 touch [-acfm][--help][--version][日期时 间][文件或目录...]</span><br><span class="line">补充说明：使用touch指令可更改文件或目录的日期时间，包括存取时间和更改时间。</span><br><span class="line">参　　数：</span><br><span class="line">　-a或–time=atime或–time=access或–time=use 　只更改存取时间。</span><br><span class="line">　-c或–no-create 　不建立任何文件。</span><br><span class="line">　-d&lt;时间日期&gt; 　使用指定的日期时间，而非现在的时间。</span><br><span class="line">　-f 　此参数将忽略不予处理，仅负责解决BSD版本touch指令的兼容性问题。</span><br><span class="line">　-m或–time=mtime或–time=modify 　只更改变动时间。</span><br><span class="line">　-r&lt;参考文件或目录&gt; 　把指定文件或目录的日期时间，统统设成和参考文件或目录的日期时间相同。</span><br><span class="line">　-t&lt;日期时间&gt; 　使用指定的日期时间，而非现在的时间。</span><br></pre></td></tr></table></figure>

<p>mv 移动</p>
<h5 id="vim"><a href="#vim" class="headerlink" title="vim"></a><a target="_blank" rel="noopener" href="https://www.cnblogs.com/firstcsharp/p/10241132.html">vim</a></h5><table>
<thead>
<tr>
<th>命令</th>
<th>简单说明</th>
</tr>
</thead>
<tbody><tr>
<td>:w</td>
<td>保存编辑后的文件内容，但不退出vim编辑器。这个命令的作用是把内存缓冲区中的数据写到启动vim时指定的文件中。</td>
</tr>
<tr>
<td>:w!</td>
<td>强制写文件，即强制覆盖原有文件。如果原有文件的访问权限不允许写入文件，例如，原有的文件为只读文件，则可使用这个命令强制写入。但是，这种命令用法仅当用户是文件的属主时才适用，而超级用户则不受此限制。</td>
</tr>
<tr>
<td>:wq</td>
<td>保存文件内容后退出vim编辑器。这个命令的作用是把内存缓冲区中的数据写到启动vim时指定的文件中，然后退出vim编辑器。另外一种替代的方法是用ZZ命令。</td>
</tr>
<tr>
<td>:wq!</td>
<td>强制保存文件内容后退出vim编辑器。这个命令的作用是把内存缓冲区中的数据强制写到启动vim时指定的文件中，然后退出vim编辑器。</td>
</tr>
<tr>
<td>ZZ</td>
<td>使用ZZ命令时，如果文件已经做过编辑处理，则把内存缓冲区中的数据写到启动vim时指定的文件中，然后退出vim编辑器。否则只是退出vim而已。注意，ZZ命令前面无需加冒号“：”，也无需按Enter键。</td>
</tr>
<tr>
<td>:q</td>
<td>在未做任何编辑处理而准备退出vim时，可以使用此命令。如果已做过编辑处理，则vim不允许用户使用“:q”命令退出，同时还会输出下列警告信息</td>
</tr>
<tr>
<td>:q!</td>
<td>强制退出vim编辑器，放弃编辑处理的结果。如果确实不需要保存修改后的文件内容，可输入“:q!”命令，强行退出vim编辑器。</td>
</tr>
<tr>
<td>:w filename</td>
<td>把编辑处理后的结果写到指定的文件中保存</td>
</tr>
<tr>
<td>:w! filename</td>
<td>把编辑处理后的结果强制保存到指定的文件中，如果文件已经存在，则覆盖现有的文件。</td>
</tr>
<tr>
<td>:wq! filename</td>
<td>把编辑处理后的结果强制保存到指定的文件中，如果文件已经存在，则覆盖现有文件，并退出vim编辑器。</td>
</tr>
</tbody></table>
<h5 id="关机重启"><a href="#关机重启" class="headerlink" title="关机重启"></a>关机重启</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">shutdown -r now</span><br></pre></td></tr></table></figure>

<h5 id="查看内存"><a href="#查看内存" class="headerlink" title="查看内存"></a>查看内存</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">free -h</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">              total        used        free      shared  buff/cache   available</span><br><span class="line">Mem:          1.7Gi       1.4Gi        79Mi       2.0Mi       187Mi       120Mi</span><br><span class="line">Swap:            0B          0B          0B</span><br></pre></td></tr></table></figure>

<p>内存剩下79M</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@iZbp17n9phketpyphsfqchZ bin]# ps -ef |grep tomcat</span><br><span class="line">root     1482136 1476782  0 11:39 pts/0    00:00:00 grep --color=auto tomcat</span><br><span class="line">[root@iZbp17n9phketpyphsfqchZ bin]# </span><br></pre></td></tr></table></figure>



<h4 id="升级内核"><a href="#升级内核" class="headerlink" title="升级内核"></a>升级内核</h4><p>1、查看当前内核版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ uname -r</span><br><span class="line">3.10.0-514.el7.x86_64</span><br><span class="line"></span><br><span class="line">$ uname -a</span><br><span class="line">Linux k8s-master 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</span><br><span class="line"></span><br><span class="line">$ cat /etc/redhat-release </span><br><span class="line">CentOS Linux release 7.3.1611 (Core) </span><br></pre></td></tr></table></figure>

<p> 2、升级内核</p>
<p>更新yum源仓库</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ yum -y update</span><br></pre></td></tr></table></figure>

<p>参考： <a target="_blank" rel="noopener" href="https://www.cnblogs.com/xzkzzz/p/9627658.html">https://www.cnblogs.com/xzkzzz/p/9627658.html</a></p>
<h4 id="错误"><a href="#错误" class="headerlink" title="错误"></a>错误</h4><blockquote>
<p>There are no enabled repos.<br> Run “yum repolist all” to see the repos you have.<br> You can enable repos with yum-config-manager –enable <repo></p>
</blockquote>
<h2 id="防火墙"><a href="#防火墙" class="headerlink" title="防火墙"></a><a target="_blank" rel="noopener" href="https://blog.csdn.net/uisoul/article/details/111670005">防火墙</a></h2><p>查看某个端口是否被占用</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">netstat  -anp  |grep 8080  # 端口号</span><br></pre></td></tr></table></figure>
<p>查看防火墙状态</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">firewall-cmd --state # running 运行中 </span><br></pre></td></tr></table></figure>
<p>查看防火墙开放端口、服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">firewall-cmd --list-ports</span><br><span class="line">firewall-cmd --list-services</span><br></pre></td></tr></table></figure>
<p>关闭防火墙</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl stop firewalld.service</span><br></pre></td></tr></table></figure>
<p>开放端口</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">firewall-cmd --add-port=8111/tcp --permanent</span><br><span class="line">firewall-cmd --reload</span><br></pre></td></tr></table></figure>
<p>firewall-cmd 主要参数</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">--get-default-zone  查询默认的区域名称</span><br><span class="line">--set-default-zone=&lt;区域名称&gt; 设置默认的区域，使其永久生效</span><br><span class="line">--get-zones  显示可用的区域</span><br><span class="line">--get-services  显示预先定义的服务</span><br><span class="line">--get-active-zones  显示当前正在使用的区域与网卡名称</span><br><span class="line">--add-source=  将源自此 IP 或子网的流量导向指定的区域</span><br><span class="line">--remove-source=  不再将源自此 IP 或子网的流量导向某个指定区域</span><br><span class="line">--add-interface=&lt;网卡名称&gt;  将源自该网卡的所有流量都导向某个指定区域</span><br><span class="line">--change-interface=&lt;网卡名称&gt; 将某个网卡与区域进行关联</span><br><span class="line">--list-all  显示当前区域的网卡配置参数、资源、端口以及服务等信息</span><br><span class="line">--list-all-zones  显示所有区域的网卡配置参数、资源、端口以及服务等信息</span><br><span class="line">--add-service=&lt;服务名&gt;  设置默认区域允许该服务的流量</span><br><span class="line">--add-port=&lt;端口号/协议&gt;  设置默认区域允许该端口的流量</span><br><span class="line">--remove-service=&lt;服务名&gt;  设置默认区域不再允许该服务的流量</span><br><span class="line">--remove-port=&lt;端口号/协议&gt;  设置默认区域不再允许该端口的流量</span><br><span class="line">--reload  让“永久生效”的配置规则立即生效，并覆盖当前的配置规则</span><br><span class="line">--panic-on  开启应急状况模式</span><br><span class="line">--panic-off  关闭应急状况模式</span><br></pre></td></tr></table></figure>


<h3 id="mysql"><a href="#mysql" class="headerlink" title="mysql"></a>mysql</h3><h4 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h4><h5 id="centos8"><a href="#centos8" class="headerlink" title="centos8"></a>centos8</h5><p>安装mysql</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install mysql-server</span><br></pre></td></tr></table></figure>

<p>检查mysql是否安装成功。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rpm -qa | grep mysql</span><br></pre></td></tr></table></figure>

<p>启动 mysql 服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">systemctl start mysqld.service #启动 mysql</span><br><span class="line">systemctl restart mysqld.service #重启 mysql</span><br><span class="line">systemctl stop mysqld.service #停止 mysql</span><br><span class="line">systemctl enable mysqld.service #设置 mysql 开机启动</span><br></pre></td></tr></table></figure>

<p>mysql常用文件路径：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">/etc/my.cnf 这是mysql的主配置文件</span><br><span class="line">/var/lib/mysql mysql数据库的数据库文件存放位置</span><br><span class="line">/var/logs/mysqld.log数据库的日志输出存放位置</span><br></pre></td></tr></table></figure>

<p>修改密码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; use mysql;</span><br><span class="line">mysql&gt; SET PASSWORD = &#x27;123456&#x27;;</span><br><span class="line">mysql&gt; flush privileges;</span><br></pre></td></tr></table></figure>

<h5 id="centos-7"><a href="#centos-7" class="headerlink" title="centos 7"></a>centos 7</h5><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_36582604/article/details/80526287">https://blog.csdn.net/qq_36582604/article/details/80526287</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/Bb15070047748/article/details/106245223?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163046379416780274155587%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&amp;request_id=163046379416780274155587&amp;biz_id=0&amp;utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-1-106245223.pc_search_all_es&amp;utm_term=centos7%E5%AE%89%E8%A3%85mysql&amp;spm=1018.2226.3001.4187">https://blog.csdn.net/Bb15070047748/article/details/106245223?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163046379416780274155587%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&amp;request_id=163046379416780274155587&amp;biz_id=0&amp;utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-1-106245223.pc_search_all_es&amp;utm_term=centos7%E5%AE%89%E8%A3%85mysql&amp;spm=1018.2226.3001.4187</a></p>
<h4 id="卸载"><a href="#卸载" class="headerlink" title="卸载"></a>卸载</h4><ol>
<li><p>停止服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">[root@iZ8xsqlmlr0q7iZ contract]#  status  mysql.service # 查看mysql状态</span><br><span class="line">● mysqld.service - MySQL Community Server</span><br><span class="line"></span><br><span class="line">[root@iZ8xsqlmlr0q7iZ contract]#  service mysql stop # 关闭mysql</span><br><span class="line">Redirecting to /bin/systemctl stop  mysql.service</span><br><span class="line"></span><br><span class="line">[root@iZ8xsqlmlr0q7iZ contract]# service mysql status</span><br><span class="line">● mysqld.service - MySQL Community Server</span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
<li><p>搜索服务组键并删除</p>
<p>查询相关组键</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rpm -qa| grep -i mysql</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">mysql-community-release-el7-5.noarch</span><br><span class="line">mysql-community-libs-5.6.51-2.el7.x86_64</span><br><span class="line">mysql-community-client-5.6.51-2.el7.x86_64</span><br><span class="line">mysql-community-server-5.6.51-2.el7.x86_64</span><br><span class="line">mysql-community-common-5.6.51-2.el7.x86_64</span><br></pre></td></tr></table></figure>

<p>删除相关组键</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rpm -ev mysql-community-release-el7-5.noarch --nodeps   </span><br></pre></td></tr></table></figure></li>
<li><p>找到本地目录并删除</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">find / -name mysql</span><br><span class="line"></span><br><span class="line">rm -rf XXX</span><br><span class="line"></span><br><span class="line">rm -rf /etc/my.cnf</span><br></pre></td></tr></table></figure></li>
<li><p>删除用户组</p>
<p>删除mysql用户以及mysql用户组</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">[root@iZ8xsqlmlr0q7iZ contract]# more /etc/passwd | grep mysql</span><br><span class="line">mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash</span><br><span class="line">[root@iZ8xsqlmlr0q7iZ contract]# more /etc/shadow | grep mysql</span><br><span class="line">mysql:!!:18870::::::</span><br><span class="line">[root@iZ8xsqlmlr0q7iZ contract]# more /etc/group | grep mysql</span><br><span class="line">mysql:x:27:</span><br><span class="line">[root@iZ8xsqlmlr0q7iZ contract]# userdel mysql</span><br><span class="line">[root@iZ8xsqlmlr0q7iZ contract]# groupdel mysql</span><br><span class="line">groupdel: group &#x27;mysql&#x27; does not exist</span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="修改密码"><a href="#修改密码" class="headerlink" title="修改密码"></a>修改密码</h5><p>暂停mysql服务，修改配置文件跳过输入密码的步骤</p>
<ol>
<li><p>修改配置文件</p>
<p>打开配置文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/etc/my.cnf</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/etc/my.cnf.d # 目录下任意文件 （mysql8.0）</span><br></pre></td></tr></table></figure>

<p>添加<code>skip-grant-tables</code></p>
</li>
<li><p>重启mysql</p>
</li>
<li><p>进入mysql</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -u root -p</span><br></pre></td></tr></table></figure></li>
<li><p>修改密码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; use mysql</span><br><span class="line">Database changed</span><br><span class="line"></span><br><span class="line">mysql&gt; ALTER USER &#x27;root&#x27;@&#x27;%&#x27; IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY &#x27;ry112233&#x27;;</span><br><span class="line">Query OK, 0 rows affected (0.00 sec)</span><br><span class="line"></span><br><span class="line">mysql&gt; flush privileges;</span><br><span class="line">Query OK, 0 rows affected (0.00 sec)</span><br><span class="line"></span><br><span class="line">mysql&gt; exit;</span><br></pre></td></tr></table></figure>

<p>如果失败查看用户列表</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; select user,host from user;</span><br><span class="line">+------------------+-----------+</span><br><span class="line">| user             | host      |</span><br><span class="line">+------------------+-----------+</span><br><span class="line">| root             | %         |</span><br><span class="line">| mysql.infoschema | localhost |</span><br><span class="line">| mysql.session    | localhost |</span><br><span class="line">| mysql.sys        | localhost |</span><br><span class="line">+------------------+-----------+</span><br><span class="line">4 rows in set (0.00 sec)</span><br></pre></td></tr></table></figure></li>
<li><p>退出还原配置并重启</p>
</li>
</ol>
<h4 id="数据导入"><a href="#数据导入" class="headerlink" title="数据导入"></a>数据导入</h4><p>方法一</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; create database nacos;			# 创建空数据库</span><br><span class="line">Query OK, 1 row affected (0.03 sec)</span><br><span class="line">mysql&gt; use nacos;						# 选择数据库</span><br><span class="line">Database changed</span><br><span class="line">mysql&gt; set names utf8;					# 设置数据库编码</span><br><span class="line">Query OK, 0 rows affected, 1 warning (0.00 sec)</span><br><span class="line">mysql&gt; source /home/nacos.sql;			# 导入数据</span><br><span class="line">Query OK, 0 rows affected, 3 warnings (0.14 sec)</span><br></pre></td></tr></table></figure>

<p>方法二</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">mysql -u用户名 -p密码 数据库名 &lt; 数据库名.sql</span><br><span class="line">#mysql -uabc_f -p abc &lt; abc.sql</span><br></pre></td></tr></table></figure>

<h4 id="错误-1"><a href="#错误-1" class="headerlink" title="错误"></a>错误</h4><h5 id="远程连接失败"><a href="#远程连接失败" class="headerlink" title="远程连接失败"></a>远程连接失败</h5><blockquote>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/h985161183/article/details/82218710">Host XXX is not allowed to connect to this MySQL server</a></p>
<p>由于Mysql配置了不支持远程连接引起的</p>
</blockquote>
<ol>
<li>登录root用户<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -uroot -p123456</span><br></pre></td></tr></table></figure></li>
<li>依次执行如下命令<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; use mysql;</span><br><span class="line">mysql&gt; select host from user where user=&#x27;root&#x27;;</span><br><span class="line"></span><br><span class="line">+-----------+</span><br><span class="line">| host      |</span><br><span class="line">+-----------+</span><br><span class="line">| localhost |</span><br><span class="line">+-----------+</span><br><span class="line">1 row in set (0.01 sec)</span><br></pre></td></tr></table></figure></li>
<li>可以看到当前主机配置信息为localhost时，将Host设置为通配符%，Host设置了“%”后便可以允许远程访问</li>
</ol>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; update user set host = &#x27;%&#x27; where user =&#x27;root&#x27;;</span><br><span class="line"></span><br><span class="line">Query OK, 1 row affected (0.01 sec)</span><br><span class="line">Rows matched: 1  Changed: 1  Warnings: 0</span><br></pre></td></tr></table></figure>
<ol start="4">
<li>Host修改完成后记得执行flush privileges使配置立即生效<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; flush privileges;</span><br><span class="line">Query OK, 0 rows affected (0.01 sec)</span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="ip被屏蔽"><a href="#ip被屏蔽" class="headerlink" title="ip被屏蔽"></a>ip被屏蔽</h5><blockquote>
<p>ava.sql.SQLException: null,  message from server: “Host ‘10.21.5.91’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’”<br>数据库多次 错误连接 造成 屏蔽了当前ip连接数据库的请求</p>
</blockquote>
<ol>
<li>mysql控制台</li>
</ol>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">mysql -uroot -p123456</span><br><span class="line">flush hosts</span><br></pre></td></tr></table></figure>

<ol start="2">
<li><p>软件操作</p>
<p>选中数据库—-刷新—-权限</p>
</li>
</ol>
<h5 id="防火墙问题"><a href="#防火墙问题" class="headerlink" title="防火墙问题"></a>防火墙问题</h5><blockquote>
<p>2003：Can’t connect to MySQL server (10060)</p>
</blockquote>
<h5 id="安装时报错：没有包mysql-server可用"><a href="#安装时报错：没有包mysql-server可用" class="headerlink" title="安装时报错：没有包mysql-server可用"></a>安装时报错：没有包mysql-server可用</h5><blockquote>
<p>yum install mysql-server<br>Loaded plugins: fastestmirror<br>Loading mirror speeds from cached hostfile<br>No package mysql-server available.<br>Error: Nothing to do</p>
</blockquote>
<p>下载mysql-community-release-el7-5.noarch.rpm</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm</span><br></pre></td></tr></table></figure>

<p>安装mysql-community-release-el7-5.noarch.rpm</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rpm -ivh mysql-community-release-el7-5.noarch.rpm</span><br></pre></td></tr></table></figure>

<p>安装 mysql-server</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install mysql-server</span><br></pre></td></tr></table></figure>



<h5 id="设置远程时报错"><a href="#设置远程时报错" class="headerlink" title="设置远程时报错"></a>设置远程时报错</h5><blockquote>
<p>ERROR 1062 (23000): Duplicate entry ‘%-root’ for key ‘PRIMARY’</p>
</blockquote>
<p>查看是否已经有 <code>user=‘root’</code> 的 <code>host</code> 变成 <code>%</code></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">use mysql;</span><br><span class="line">select user, host from user;</span><br></pre></td></tr></table></figure>

<p>刷新</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">flush privileges</span><br></pre></td></tr></table></figure>



<h5 id="登录失败"><a href="#登录失败" class="headerlink" title="登录失败"></a>登录失败</h5><blockquote>
<p>ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)</p>
</blockquote>
<p>第一：Access denied（拒绝访问）；第二：using password：NO/YES。这里这个using password 的是是否输入了密码，输入了就表示YES，没有就输出NO。</p>
<p>出现Access denied的原因有如下可能：<br>（1）MySQL的服务器停止了<br>（2）用户的端口号或者IP导致拒绝访问<br>（3）MySQL的配置文件错误（my.ini等文件）<br>（4）root用户的密码错误</p>
<h5 id="修改密码失败"><a href="#修改密码失败" class="headerlink" title="修改密码失败"></a>修改密码失败</h5><blockquote>
<p>ERROR 1819 (HY000): Your password does not satisfy the current policy requirements</p>
</blockquote>
<p>密码不符合策略</p>
<p>把MySQL的密码校验强度改为低风险</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">set global validate_password_policy=LOW;</span><br></pre></td></tr></table></figure>

<p>修改MySQL的密码长度</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">set global validate_password_length=5;</span><br></pre></td></tr></table></figure>

<p>修改MySQL密码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ALTER USER &#x27;root&#x27;@&#x27;localhost&#x27; IDENTIFIED BY &#x27;admin&#x27;; </span><br></pre></td></tr></table></figure>

<p>ALTER USER ‘test‘@’localhost’ IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY ‘ry112233’;</p>
<p>ALTER USER ‘root‘@’localhost’ IDENTIFIED BY ‘ry112233’; </p>
<h2 id="Jdk"><a href="#Jdk" class="headerlink" title="Jdk"></a>Jdk</h2><h5 id="命令行安装"><a href="#命令行安装" class="headerlink" title="命令行安装"></a>命令行安装</h5><ol>
<li><p>查看是否已安装JDK</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum list installed |grep java</span><br></pre></td></tr></table></figure></li>
<li><p>查看JDK版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y list java*</span><br></pre></td></tr></table></figure></li>
<li><p>安装JDK</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y java-1.8.0-openjdk.x86_64</span><br></pre></td></tr></table></figure></li>
<li><p>查看JDK版本信息</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -version</span><br></pre></td></tr></table></figure></li>
<li><p>卸载JDK</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y remove java-1.8.0-openjdk.x86_64</span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="手动安装"><a href="#手动安装" class="headerlink" title="手动安装"></a>手动安装</h5><ol>
<li><p><a target="_blank" rel="noopener" href="https://www.oracle.com/java/technologies/javase-jsp-downloads.html">官网下载安装包</a></p>
</li>
<li><p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar zxvf jdk-8u221-linux-x64.tar.gz </span><br></pre></td></tr></table></figure></li>
<li><p>环境配置</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi /etc/profile</span><br></pre></td></tr></table></figure>

<p>尾部添加</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">JAVA_HOME=/usr/local/java/jdk1.8.0_221 # 以实际解压目录为准</span><br><span class="line">PATH=$JAVA_HOME/bin:$PATH</span><br><span class="line">CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar</span><br><span class="line">export JAVA_HOME</span><br><span class="line">export PATH</span><br><span class="line">export CLASSPATH</span><br></pre></td></tr></table></figure></li>
<li><p>刷新环境/重启</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source /etc/profile</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="操作"><a href="#操作" class="headerlink" title="操作"></a>操作</h4><h5 id="查询JDK路径"><a href="#查询JDK路径" class="headerlink" title="查询JDK路径"></a>查询JDK路径</h5><ol>
<li><p>jdk的安装目录</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">which</span> java	</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/usr/bin/java</span><br></pre></td></tr></table></figure></li>
<li><p>列出这个目录下的文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ls -lrt /usr/bin/java</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">lrwxrwxrwx 1 root root 22 Sep 27 11:23 /usr/bin/java -&gt; /etc/alternatives/java</span><br></pre></td></tr></table></figure></li>
<li><p>出现箭头，继续追踪</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ls -lrt /etc/alternatives/java</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">lrwxrwxrwx 1 root root 73 Sep 27 11:23 /etc/alternatives/java -&gt; /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java</span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="配置环境变量"><a href="#配置环境变量" class="headerlink" title="配置环境变量"></a>配置环境变量</h5><blockquote>
<p>参考：<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_44061444/article/details/120758337">https://blog.csdn.net/weixin_44061444/article/details/120758337</a></p>
</blockquote>
<ol>
<li><p>进入</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /etc/profile</span><br></pre></td></tr></table></figure></li>
<li><p>设置</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java # 以实际解压目录为准</span><br><span class="line">PATH=$JAVA_HOME/bin:$PATH</span><br><span class="line">CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar</span><br><span class="line">export JAVA_HOME</span><br><span class="line">export PATH</span><br><span class="line">export CLASSPATH</span><br></pre></td></tr></table></figure>

<blockquote>
<p>PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin 可以以 : 添加多个环境变量</p>
</blockquote>
</li>
<li><p>刷新</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source /etc/profile</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="错误-2"><a href="#错误-2" class="headerlink" title="错误"></a>错误</h4><h5 id="jdk下载错误了"><a href="#jdk下载错误了" class="headerlink" title="jdk下载错误了"></a>jdk下载错误了</h5><blockquote>
<p>-bash: /usr/local/java/jdk1.8.0_301/bin/javac: cannot execute binary file<br>jdk-8u301-linux-x64.tar.gz 是linux版本的</p>
</blockquote>
<h2 id="Tomcat"><a href="#Tomcat" class="headerlink" title="Tomcat"></a>Tomcat</h2><ol>
<li><p><a target="_blank" rel="noopener" href="https://tomcat.apache.org/download-90.cgi">官网下载</a> apache-tomcat-8.5.70.tar.gz</p>
</li>
<li><p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar zxvf apache-tomcat-8.5.70.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>移动文件到指定目录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mv apache-tomcat-8.5.70 /usr/local/tomcat</span><br></pre></td></tr></table></figure></li>
<li><p>启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/usr/local/tomcat/bin # sh startup.sh</span><br></pre></td></tr></table></figure></li>
<li><p>检查是否成功</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl localhost:8080</span><br></pre></td></tr></table></figure></li>
<li><p>开启防火墙等</p>
</li>
</ol>
<h2 id="Redis-安装"><a href="#Redis-安装" class="headerlink" title="Redis 安装"></a>Redis 安装</h2><p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/xzjf/p/15021036.html">https://www.cnblogs.com/xzjf/p/15021036.html</a></p>
<h4 id="安装-1"><a href="#安装-1" class="headerlink" title="安装"></a>安装</h4><h5 id="全网络-安装"><a href="#全网络-安装" class="headerlink" title="全网络 安装"></a>全网络 安装</h5><ol>
<li><p>下载<a target="_blank" rel="noopener" href="https://redis.io/download">官网</a></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget http://download.redis.io/releases/redis-5.0.7.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar -zvxf redis-5.0.7.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>移动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mv redis-5.0.7 /usr/local/redis</span><br></pre></td></tr></table></figure></li>
<li><p>编译</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Hint: It&#x27;s a good idea to run &#x27;make test&#x27; ;)</span><br><span class="line">make[1]: Leaving directory `/usr/local/redis/src&#x27;</span><br></pre></td></tr></table></figure></li>
<li><p>安装</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make PREFIX=/usr/local/redis install</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">cd src &amp;&amp; make install</span><br><span class="line">make[1]: Entering directory `/usr/local/redis/src&#x27;</span><br><span class="line">    CC Makefile.dep</span><br><span class="line">make[1]: Leaving directory `/usr/local/redis/src&#x27;</span><br><span class="line">make[1]: Entering directory `/usr/local/redis/src&#x27;</span><br><span class="line">Hint: It&#x27;s a good idea to run &#x27;make test&#x27; ;)</span><br><span class="line">    INSTALL install</span><br><span class="line">make[1]: Leaving directory `/usr/local/redis/src&#x27;</span><br></pre></td></tr></table></figure>

<p>测试</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">cd src &amp;&amp; make test</span><br><span class="line">make[1]: Entering directory `/usr/local/redis/src&#x27;</span><br><span class="line">You need tcl 8.5 or newer in order to run the Redis test # 升级 yum install tcl</span><br><span class="line">make[1]: *** [test] Error 1</span><br><span class="line">make[1]: Leaving directory `/usr/local/redis/src&#x27;</span><br><span class="line">make: *** [test] Error 2</span><br></pre></td></tr></table></figure></li>
<li><p>修改配置文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">bind *				# 允许所有的访问，或者直接注释掉</span><br><span class="line">port 6379 </span><br><span class="line">daemonize yes</span><br><span class="line">protected-mode no</span><br><span class="line">requirepass password</span><br></pre></td></tr></table></figure></li>
<li><p>启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./bin/redis-server&amp; ./redis.conf</span><br></pre></td></tr></table></figure></li>
<li><p>关闭</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/usr/local/redis/srv/redis-cli shutdown</span><br></pre></td></tr></table></figure></li>
<li><p>设置开机自启</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">vi /etc/rc.local //在里面添加内容：</span><br><span class="line">/usr/local/redis/bin/redis-server </span><br><span class="line">/usr/local/redis/etc/redis.conf (意思就是开机调用这段开启redis的命令)</span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="手动下载-安装"><a href="#手动下载-安装" class="headerlink" title="手动下载 安装"></a>手动下载 安装</h5><ol>
<li><p>官网下载</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://redis.io/download</span><br></pre></td></tr></table></figure></li>
<li><p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar -zxf redis-6.2.6.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>redis下执行编译</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make</span><br></pre></td></tr></table></figure></li>
<li><p>进入src执行Redis安装</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make install</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">    CC Makefile.dep</span><br><span class="line"></span><br><span class="line">Hint: It&#x27;s a good idea to run &#x27;make test&#x27; ;)</span><br><span class="line"></span><br><span class="line">    INSTALL redis-server</span><br><span class="line">    INSTALL redis-benchmark</span><br><span class="line">    INSTALL redis-cli</span><br></pre></td></tr></table></figure></li>
<li><p>部署</p>
<p>为了方便管理，将Redis文件中的conf配置文件和常用命令移动到统一文件中</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># ls</span></span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">00-RELEASENOTES  BUGS  CONDUCT  CONTRIBUTING  COPYING  deps  INSTALL  Makefile  MANIFESTO  README.md  redis.conf  runtest  runtest-cluster  runtest-moduleapi  runtest-sentinel  sentinel.conf  src  tests  TLS.md  utils </span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># mkdir etc</span></span><br><span class="line"><span class="comment"># mkdir bin</span></span><br><span class="line"><span class="comment"># ls</span></span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">00-RELEASENOTES  bin  BUGS  CONDUCT  CONTRIBUTING  COPYING  deps  etc  INSTALL  Makefile  MANIFESTO  README.md  redis.conf  runtest  runtest-cluster  runtest-moduleapi  runtest-sentinel  sentinel.conf  src  tests  TLS.md  utils</span><br></pre></td></tr></table></figure>

<p>移动相关文件到新建目录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># mv redis.conf /usr/local/redis/etc/</span><br><span class="line"># cd src/</span><br><span class="line"># mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server /usr/local/redis/bin/</span><br></pre></td></tr></table></figure>

<p>检测是否移动到位</p>
</li>
<li><p>启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./redis-server</span><br></pre></td></tr></table></figure></li>
<li><p>设置后台启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd etc/</span><br></pre></td></tr></table></figure></li>
<li><p>修改配置</p>
<p>设置后台运行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># By default Redis does not run as a daemon. Use &#x27;yes&#x27; if you need it.</span><br><span class="line"># Note that Redis will write a pid file in /var/run/redis.pid when daemonized.</span><br><span class="line"># When Redis is supervised by upstart or systemd, this parameter has no impact.</span><br><span class="line">daemonize yes</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>重启(bin 目录下)</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">redis-server /usr/local/redis/etc/redis.conf</span><br></pre></td></tr></table></figure>

<p>连接客户端</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./redis-cli</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">127.0.0.1:6379&gt; </span><br><span class="line">127.0.0.1:6379&gt; exit</span><br></pre></td></tr></table></figure>

<p>查看进程</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">netstat -tunpl|grep 6379</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      1602016/redis-serve </span><br><span class="line">tcp6       0      0 ::1:6379                :::*                    LISTEN      1602016/redis-serve </span><br></pre></td></tr></table></figure></li>
<li><p>参考</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://www.cnblogs.com/zdd-java/p/10288734.html</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="错误-3"><a href="#错误-3" class="headerlink" title="错误"></a>错误</h4><h5 id="测试错误"><a href="#测试错误" class="headerlink" title="测试错误"></a>测试错误</h5><blockquote>
<p>ARNING The following tests failed:</p>
<p>*** [err]: Slave should be able to synchronize with the master in tests/integration/replication-psync.tcl<br>Replication not started.<br>*** [err]: Active defrag big keys in tests/unit/memefficiency.tcl<br>Expected condition ‘$max_latency &lt;= 120’ to be true (690 &lt;= 120)<br>Cleanup: may take some time… OK<br>make[1]: *** [test] Error 1<br>make[1]: Leaving directory `/usr/local/redis/src’<br>make: *** [test] Error 2</p>
</blockquote>
<p>重新text</p>
<blockquote>
<p>执行make test时遇到You need tcl 8.5 or newer in order to run the Redistest</p>
</blockquote>
<p>4 <strong>编译</strong></p>
<p>cd到/usr/local/redis目录，输入命令make执行编译命令，接下来控制台会输出各种编译过程中输出的内容</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">make</span><br></pre></td></tr></table></figure>

<p> <strong>安装</strong></p>
<h2 id="Mean"><a href="#Mean" class="headerlink" title="Mean"></a>Mean</h2><ol>
<li><p>下载</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz</span><br></pre></td></tr></table></figure>

<p>或者<a target="_blank" rel="noopener" href="http://maven.apache.org/download.cgi">官网下载</a></p>
</li>
<li><p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar -zxvf apache-maven-3.5.4-bin.tar.gz -C /usr/local/maven</span><br></pre></td></tr></table></figure></li>
<li><p>修改环境变量</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /etc/profile</span><br></pre></td></tr></table></figure>

<p>末尾添加</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">export M2_HOME=/usr/local/maven</span><br><span class="line">export PATH=$PATH:$M2_HOME/bin</span><br></pre></td></tr></table></figure>

<p>启用环境变量</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source /etc/profile</span><br></pre></td></tr></table></figure></li>
<li><p>测试是否成功</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mvn -version</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Maven home: /usr/local/maven</span><br><span class="line">Java version: 1.8.0_301, vendor: Oracle Corporation, runtime: /usr/local/jdk/jre</span><br><span class="line">Default locale: en_US, platform encoding: UTF-8</span><br><span class="line">OS name: &quot;linux&quot;, version: &quot;4.18.0-305.3.1.el8.x86_64&quot;, arch: &quot;amd64&quot;, family: &quot;unix&quot;</span><br></pre></td></tr></table></figure></li>
</ol>
<h3 id="Nacos"><a href="#Nacos" class="headerlink" title="Nacos"></a>Nacos</h3><h4 id="安装-2"><a href="#安装-2" class="headerlink" title="安装"></a>安装</h4><ol>
<li><p>下载</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">https://github.com/alibaba/nacos/releases</span><br><span class="line">https://github.com/alibaba/nacos/releases/download/2.0.3/nacos-server-2.0.3.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>修改配置 数据库连接</p>
</li>
<li><p>创建数据库</p>
</li>
<li><p>启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">sh startup.sh -m standalone</span><br><span class="line">#单节点方式启动</span><br><span class="line">ExecStart=/opt/module/nacos/bin/startup.sh -m standalone</span><br><span class="line"># 集群方式启动</span><br><span class="line"># ExecStart=/opt/module/nacos/bin/startup.sh</span><br><span class="line">ExecReload=/opt/module/nacos/bin/shutdown.sh</span><br><span class="line">ExecStop=/opt/module/nacos/bin/shutdown.sh</span><br><span class="line">PrivateTmp=true</span><br></pre></td></tr></table></figure></li>
</ol>
<p>编译</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd /nacos # 在nacos文件下</span><br><span class="line">mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U # 执行编译</span><br></pre></td></tr></table></figure>



<h4 id="错误-4"><a href="#错误-4" class="headerlink" title="错误"></a>错误</h4><h5 id="Unable-to-start-web-server-nested-exception-is-org-springframework-boot-web-server-WebServerException-Unable-to-start-embedded-Tomcat"><a href="#Unable-to-start-web-server-nested-exception-is-org-springframework-boot-web-server-WebServerException-Unable-to-start-embedded-Tomcat" class="headerlink" title="Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat"></a>Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat</h5><h5 id="启动失败"><a href="#启动失败" class="headerlink" title="启动失败"></a>启动失败</h5><blockquote>
<p>/usr/local/jdk/bin/java -Djava.ext.dirs=/usr/local/jdk/jre/lib/ext:/usr/local/jdk/lib/ext  -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Dnacos.member.list= -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/home/nacos/plugins/health,/home/nacos/plugins/cmdb -Dnacos.home=/home/nacos -jar /home/nacos/target/nacos-server.jar  –spring.config.additional-location=file:/home/nacos/conf/ –logging.config=/home/nacos/conf/nacos-logback.xml –server.max-http-header-size=524288</p>
<p>startup.sh: 129: startup.sh: [[: not found<br>nacos is starting with cluster<br>nacos is starting，you can check the /home/nacos/logs/start.out</p>
</blockquote>
<p>改用命令bash -f ./startup.sh -m standalone启动</p>
<h5 id="没有数据源设置"><a href="#没有数据源设置" class="headerlink" title="没有数据源设置"></a>没有数据源设置</h5><blockquote>
<p>No DataSource set</p>
</blockquote>
<p>注释掉mysql</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># spring.datasource.platform=mysql</span></span><br></pre></td></tr></table></figure>



<h5 id="nacos-Request-error-please-try-again-later"><a href="#nacos-Request-error-please-try-again-later" class="headerlink" title="nacos Request error, please try again later!"></a>nacos Request error, please try again later!</h5><p>删除nacos目录下data/protocol目录，重新启动nacos服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">cd nacos/data</span><br><span class="line"></span><br><span class="line">rm -rf protocol/</span><br><span class="line"></span><br><span class="line">sh startup.sh -m standalone</span><br></pre></td></tr></table></figure>



<h5 id="启动失败-JAVA-HOME-环境变量"><a href="#启动失败-JAVA-HOME-环境变量" class="headerlink" title="启动失败 JAVA_HOME 环境变量"></a>启动失败 JAVA_HOME 环境变量</h5><blockquote>
<p> ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! !!</p>
</blockquote>
<p><strong>方法1</strong>修改 JAVA_HOME 路径</p>
<p>把下面代码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[ ! -e &quot;$JAVA_HOME/bin/java&quot; ] &amp;&amp; JAVA_HOME=$HOME/jdk/java</span><br><span class="line">[ ! -e &quot;$JAVA_HOME/bin/java&quot; ] &amp;&amp; JAVA_HOME=/usr/java</span><br><span class="line">[ ! -e &quot;$JAVA_HOME/bin/java&quot; ] &amp;&amp; JAVA_HOME=/opt/taobao/java</span><br><span class="line">[ ! -e &quot;$JAVA_HOME/bin/java&quot; ] &amp;&amp; unset JAVA_HOME</span><br></pre></td></tr></table></figure>

<p>替换成</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[ ! -e &quot;$JAVA_HOME/bin/java&quot; ] &amp;&amp; JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java</span><br></pre></td></tr></table></figure>

<p>启动</p>
<p><strong>报错：</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java/bin/java -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java/lib/ext  -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Xloggc:/root/work/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/root/work/nacos/plugins/health,/root/work/nacos/plugins/cmdb -Dnacos.home=/root/work/nacos -jar /root/work/nacos/target/nacos-server.jar  --spring.config.additional-location=file:/root/work/nacos/conf/ --logging.config=/root/work/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288</span><br><span class="line">nacos is starting with standalone</span><br><span class="line">nacos is starting，you can check the /root/work/nacos/logs/start.out</span><br></pre></td></tr></table></figure>

<p>修改</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[ ! -e &quot;$JAVA_HOME/bin/java&quot; ] &amp;&amp; JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre</span><br></pre></td></tr></table></figure>



<p>报错</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/bin/java -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64/jre/lib/ext  -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Xloggc:/root/work/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/root/work/nacos/plugins/health,/root/work/nacos/plugins/cmdb -Dnacos.home=/root/work/nacos -jar /root/work/nacos/target/nacos-server.jar  --spring.config.additional-location=file:/root/work/nacos/conf/ --logging.config=/root/work/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288</span><br><span class="line">OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e0000000, 268435456, 0) failed; error=&#x27;Cannot allocate memory&#x27; (errno=12)</span><br><span class="line">#</span><br><span class="line"># There is insufficient memory for the Java Runtime Environment to continue.</span><br><span class="line"># Native memory allocation (mmap) failed to map 268435456 bytes for committing reserved memory.</span><br><span class="line"># An error report file with more information is saved as:</span><br><span class="line"># /root/work/nacos/bin/hs_err_pid1482049.log</span><br></pre></td></tr></table></figure>





<h3 id="Nignx"><a href="#Nignx" class="headerlink" title="Nignx"></a>Nignx</h3><blockquote>
<p>nginx依赖于pcre和zlib,安装前先搭建pcre和zlib</p>
</blockquote>
<h4 id="环境搭建"><a href="#环境搭建" class="headerlink" title="环境搭建"></a>环境搭建</h4><ol>
<li><p>安装gcc环境</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install gcc-c++</span><br></pre></td></tr></table></figure></li>
<li><p>安装<a target="_blank" rel="noopener" href="https://sourceforge.net/projects/pcre/files/pcre/">pcre环境</a></p>
<p>rewrite 模块需要 <a target="_blank" rel="noopener" href="http://www.pcre.org/">pcre 库</a>， pcre是nginx的http模块用来解析正则表达式用的</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y pcre pcre-devel</span><br></pre></td></tr></table></figure></li>
<li><p>安装<a target="_blank" rel="noopener" href="http://zlib.net/">zlib环境</a></p>
<p> gzip 模块需要 zlib 库</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y zlib zlib-devel</span><br></pre></td></tr></table></figure></li>
<li><p>安装<a target="_blank" rel="noopener" href="http://www.openssl.org/">openssl环境</a></p>
<p>ssl 功能需要 openssl 库,nginx不仅支持http协议还支持https协议（在ssl协议上传输http）所以需要openssl包</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y openssl openssl-devel</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="手动安装-1"><a href="#手动安装-1" class="headerlink" title="手动安装"></a>手动安装</h4><ol>
<li><p><a target="_blank" rel="noopener" href="https://nginx.org/en/download.html">官网下载</a></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget -c https://nginx.org/download/nginx-1.18.0.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>用configure命令创建一个makeFile文件, 因为C语言在编译的时候需要makeFile文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">./configure \</span><br><span class="line">--prefix=/usr/local/nginx\ # 安装地址</span><br><span class="line">--conf-path=/usr/local/nginx/nginx.conf \</span><br><span class="line">--pid-path=/var/run/nginx/nginx.pid \</span><br><span class="line">--lock-path=/var/lock/nginx.lock \</span><br><span class="line">--error-log-path=/var/log/nginx/error.log \</span><br><span class="line">--http-log-path=/var/log/nginx/access.log \</span><br><span class="line">--with-http_gzip_static_module \</span><br><span class="line">--http-client-body-temp-path=/var/temp/nginx/client \</span><br><span class="line">--http-proxy-temp-path=/var/temp/nginx/proxy \</span><br><span class="line">--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \</span><br><span class="line">--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \</span><br><span class="line">--http-scgi-temp-path=/var/temp/nginx/scgi</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi</span><br></pre></td></tr></table></figure></li>
<li><p>编译nginx的源代码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@ nginx]#  make</span><br></pre></td></tr></table></figure></li>
<li><p>安装</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@ nginx]# make install</span><br></pre></td></tr></table></figure></li>
<li><p>启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[/usr/local/nginx/sbin]# ./nginx</span><br></pre></td></tr></table></figure></li>
<li><p>关闭</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[/usr/local/nginx/sbin]# ./nginx -s stop</span><br></pre></td></tr></table></figure></li>
<li><p>重启</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[/usr/local/nginx/sbin]# ./nginx -s reload # 报错</span><br></pre></td></tr></table></figure></li>
<li><p>检测配置是否正确</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nginx -t</span><br></pre></td></tr></table></figure></li>
<li><p>关闭</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nginx -s quit</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="yum安装（推荐）"><a href="#yum安装（推荐）" class="headerlink" title="yum安装（推荐）"></a>yum安装（推荐）</h4><ol>
<li><p>下载nginx</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install nginx -y</span><br></pre></td></tr></table></figure></li>
<li><p>查看nginx</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl status nginx.service</span><br></pre></td></tr></table></figure></li>
<li><p>启动nginx</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl start nginx.service</span><br></pre></td></tr></table></figure></li>
<li><p>修改配置信息</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/etc/nginx/</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim nginx.conf.default </span><br></pre></td></tr></table></figure></li>
<li><p>查看静态文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/usr/share/nginx/html</span><br></pre></td></tr></table></figure></li>
<li><p>设置开机自启</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl enable nginx.service</span><br></pre></td></tr></table></figure></li>
<li><p>查看版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nginx -v</span><br></pre></td></tr></table></figure></li>
<li><p>卸载nginx</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum remove nginx</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="多个二级域名分配不同路径"><a href="#多个二级域名分配不同路径" class="headerlink" title="多个二级域名分配不同路径"></a>多个二级域名分配不同路径</h4><p>nginx.conf</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br></pre></td><td class="code"><pre><span class="line">user nginx;</span><br><span class="line">worker_processes auto;</span><br><span class="line">error_log /etc/nginx/log/error.log;</span><br><span class="line">pid /run/nginx.pid;</span><br><span class="line"></span><br><span class="line">include /usr/share/nginx/modules/*.conf;</span><br><span class="line"></span><br><span class="line">events &#123;</span><br><span class="line">    worker_connections 1024;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">http &#123;</span><br><span class="line">    log_format  main  &#x27;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#x27;</span><br><span class="line">                      &#x27;$status $body_bytes_sent &quot;$http_referer&quot; &#x27;</span><br><span class="line">                      &#x27;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#x27;;</span><br><span class="line"></span><br><span class="line">    access_log  /etc/nginx/log/access.log  main;</span><br><span class="line"></span><br><span class="line">    sendfile            on;</span><br><span class="line">    tcp_nopush          on;</span><br><span class="line">    tcp_nodelay         on;</span><br><span class="line">    keepalive_timeout   65;</span><br><span class="line">    types_hash_max_size 2048;</span><br><span class="line"></span><br><span class="line">	#设置允许发布内容为8M</span><br><span class="line">	client_max_body_size 8M;</span><br><span class="line">	client_body_buffer_size 128k;</span><br><span class="line">	</span><br><span class="line">    include             /etc/nginx/mime.types;</span><br><span class="line">    default_type        application/octet-stream;</span><br><span class="line"></span><br><span class="line">    include /etc/nginx/conf.d/*.conf; #配置二级域名放在这里面</span><br><span class="line">	</span><br><span class="line">	#积木</span><br><span class="line">	upstream bricksServices &#123;</span><br><span class="line">        server localhost:8000;</span><br><span class="line">    &#125;</span><br><span class="line">    server &#123;</span><br><span class="line">        listen       80;</span><br><span class="line">        server_name  localhost;</span><br><span class="line">		</span><br><span class="line">        # listen       80 default_server;</span><br><span class="line">        # listen       [::]:80 default_server;</span><br><span class="line">        #server_name  _;</span><br><span class="line">		</span><br><span class="line">        </span><br><span class="line"></span><br><span class="line">        include /etc/nginx/default.d/*.conf;</span><br><span class="line"></span><br><span class="line">        location / &#123;</span><br><span class="line">			root  /usr/share/nginx/html;</span><br><span class="line">			try_files $uri $uri/ /index.html;</span><br><span class="line">			index  index.html index.htm;</span><br><span class="line">        &#125;</span><br><span class="line">		</span><br><span class="line">		# 积木</span><br><span class="line">		location /bricks &#123;</span><br><span class="line">            proxy_pass http://bricksServices;           </span><br><span class="line">        &#125;</span><br><span class="line">		</span><br><span class="line">        error_page 404 /404.html;</span><br><span class="line">            location = /40x.html &#123;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        error_page 500 502 503 504 /50x.html;</span><br><span class="line">            location = /50x.html &#123;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">	server &#123;</span><br><span class="line">        listen       80;</span><br><span class="line">        server_name  ruiyi.kldyxf.com;</span><br><span class="line"></span><br><span class="line">        access_log  /etc/nginx/log/ruiyi.kldyxf.com.log main;</span><br><span class="line"></span><br><span class="line">        </span><br><span class="line">		location / &#123;</span><br><span class="line">			root   /usr/share/nginx/html/ruiyi;</span><br><span class="line">			try_files $uri $uri/ /index.html;</span><br><span class="line">			index  index.html index.htm;</span><br><span class="line">		&#125;</span><br><span class="line">		</span><br><span class="line">		# 积木</span><br><span class="line">		location /bricks &#123;</span><br><span class="line">            proxy_pass http://bricksServices;           </span><br><span class="line">        &#125;</span><br><span class="line">        error_page 404 /404.html;</span><br><span class="line">            location = /40x.html &#123;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        error_page 500 502 503 504 /50x.html;</span><br><span class="line">            location = /50x.html &#123;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">	server &#123;</span><br><span class="line">        listen       80;</span><br><span class="line">        server_name  blog.kldyxf.com;</span><br><span class="line"></span><br><span class="line">        access_log  /etc/nginx/log/blog.kldyxf.com.log main;</span><br><span class="line"></span><br><span class="line">        </span><br><span class="line">		location / &#123;</span><br><span class="line">			root   /usr/share/nginx/html/blog;</span><br><span class="line">			try_files $uri $uri/ /index.html;</span><br><span class="line">			index  index.html index.htm;</span><br><span class="line">		&#125;</span><br><span class="line">		</span><br><span class="line">		# 积木</span><br><span class="line">		location /bricks &#123;</span><br><span class="line">            proxy_pass http://bricksServices;           </span><br><span class="line">        &#125;</span><br><span class="line">        error_page 404 /404.html;</span><br><span class="line">            location = /40x.html &#123;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        error_page 500 502 503 504 /50x.html;</span><br><span class="line">            location = /50x.html &#123;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>conf.d/*.conf</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"># 下级导航 xxx.com/ruiyi</span><br><span class="line">server &#123;</span><br><span class="line">	server_name  ruiyi.kldyxf.com;</span><br><span class="line">   </span><br><span class="line">	location /ruiyi &#123;</span><br><span class="line">		alias  XXXX/ruiyi/;</span><br><span class="line">		index  index.html index.htm;</span><br><span class="line">	&#125;</span><br><span class="line">	error_page 404 /404.html;</span><br><span class="line">		location = /40x.html &#123;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	error_page 500 502 503 504 /50x.html;</span><br><span class="line">		location = /50x.html &#123;</span><br><span class="line">	&#125;</span><br><span class="line">	access_log /etc/nginx/log/ruiyi.kldyxf.com.log; # 日志</span><br><span class="line">&#125;</span><br><span class="line"># 下级服务 xxx.com/blog</span><br><span class="line">server &#123;</span><br><span class="line">	server_name  blog.kldyxf.com;</span><br><span class="line">   </span><br><span class="line">	location /blog &#123;</span><br><span class="line">		proxy_set_header   X-Real-IP $remote_addr;</span><br><span class="line">		proxy_set_header   Host      $http_host;</span><br><span class="line">		proxy_pass         http://0.0.0.0:10080;</span><br><span class="line">	&#125;</span><br><span class="line">	error_page 404 /404.html;</span><br><span class="line">		location = /40x.html &#123;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	error_page 500 502 503 504 /50x.html;</span><br><span class="line">		location = /50x.html &#123;</span><br><span class="line">	&#125;</span><br><span class="line">	access_log /etc/nginx/log/blog.kldyxf.com.log; # 日志</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_32930863/article/details/104601413?ops_request_misc=&amp;request_id=&amp;biz_id=102&amp;utm_term=nginx%20%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86%20%E7%8E%AF%E5%A2%83&amp;utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-3-104601413.first_rank_v2_pc_rank_v29&amp;spm=1018.2226.3001.4187">https://blog.csdn.net/qq_32930863/article/details/104601413?ops_request_misc=&amp;request_id=&amp;biz_id=102&amp;utm_term=nginx%20%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86%20%E7%8E%AF%E5%A2%83&amp;utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-3-104601413.first_rank_v2_pc_rank_v29&amp;spm=1018.2226.3001.4187</a></p>
<h4 id="错误-5"><a href="#错误-5" class="headerlink" title="错误"></a>错误</h4><blockquote>
<p>nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (2: No such file or directory)<br>2021/08/27 10:54:45 [emerg] 12489#0: mkdir() “/var/temp/nginx/client” failed (2: No such file or directory)</p>
</blockquote>
<p>可能是没有 /var/log/nginx</p>
<p><a target="_blank" rel="noopener" href="http://127.0.0.1:8080/menu/getMenuList%EF%BC%8C%E7%9C%81%E7%95%A5%E4%BA%86%E5%8C%B9%E9%85%8D%E5%88%B0%E7%9A%84/api/%E8%B7%AF%E5%BE%84%EF%BC%9B">http://127.0.0.1:8080/menu/getMenuList，省略了匹配到的/api/路径；</a></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">location /api/ &#123; </span><br><span class="line">  proxy_pass   http://127.0.0.1:8080/;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>当nginx配置文件proxy_pass后边的url不带”/“时，代理到后端的路径为：<a target="_blank" rel="noopener" href="http://127.0.0.1:8080/api/menu/getMenuList%EF%BC%8C%E8%BF%9E%E5%90%8C%E5%8C%B9%E9%85%8D%E5%88%B0%E7%9A%84/api/%E8%B7%AF%E5%BE%84%E4%B8%80%E8%B5%B7%E4%BB%A3%E7%90%86%E4%BA%86%EF%BC%9B">http://127.0.0.1:8080/api/menu/getMenuList，连同匹配到的/api/路径一起代理了；</a></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">location /api/ &#123; </span><br><span class="line">  proxy_pass   http://127.0.0.1:8080;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="NodeJs"><a href="#NodeJs" class="headerlink" title="NodeJs"></a>NodeJs</h3><p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/lpbottle/p/install_nodejs.html">https://www.cnblogs.com/lpbottle/p/install_nodejs.html</a></p>
<h4 id="安装-v10-13"><a href="#安装-v10-13" class="headerlink" title="安装 v10.13"></a>安装 v10.13</h4><ol>
<li><p>安装必要的编译软件包</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo yum install gcc gcc-c++</span><br></pre></td></tr></table></figure></li>
<li><p>源码下载</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd /usr/local/src</span><br><span class="line">wget https://npm.taobao.org/mirrors/node/v10.13.0/node-v10.13.0.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar xvf node-v10.13.0.tar.gz</span><br></pre></td></tr></table></figure></li>
<li><p>编译</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">cd node-v10.13.0/</span><br><span class="line">./configure</span><br><span class="line">make</span><br></pre></td></tr></table></figure></li>
<li><p>检查 gcc 的版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gcc -v</span><br></pre></td></tr></table></figure></li>
<li><p>安装Nodejs</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo make install</span><br></pre></td></tr></table></figure></li>
<li><p>验证</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">node -v</span><br></pre></td></tr></table></figure></li>
</ol>
<h4 id="安装-3"><a href="#安装-3" class="headerlink" title="安装"></a>安装</h4><ol>
<li><p>下载</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://nodejs.org/dist/v14.17.6/node-v14.17.6-linux-x64.tar.xz</span><br></pre></td></tr></table></figure>

<p>解压</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">tar xf node-v14.17.6-linux-x64.tar.xz</span><br><span class="line">mv /usr/local/node-v14.17.6-linux-x64 /usr/local/node</span><br></pre></td></tr></table></figure></li>
<li><p>配置nodejs</p>
<p>修改配置 <code>vim /etc/profile </code></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">export NODE_PATH=/usr/local/node</span><br><span class="line">export PATH=$NODE_PATH/bin/:$PATH</span><br><span class="line"># echo &#x27;export PATH=/app/node/bin/:$PATH #oldboylidao&#x27; &gt;&gt;/etc/profile </span><br></pre></td></tr></table></figure>

<p>刷新配置 <code>source /etc/profile </code></p>
</li>
<li><p>检查</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">   ```</span><br><span class="line"></span><br><span class="line">   </span><br><span class="line"></span><br><span class="line">yum groupinstall &quot;Development tools&quot; yum -y install gcc wget gcc-c++ automake autoconf libtool libxml2-devel libxslt-devel perl-devel perl-ExtUtils-Embed pcre-devel openssl-devel</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#### 卸载</span><br><span class="line"></span><br><span class="line">1. 卸载npm </span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>npm uninstall npm -g</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">2. 卸载node</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>remove nodejs npm -y</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">3. 看看是否有残留</span><br><span class="line"></span><br><span class="line">              进入 /usr/local/lib 删除所有 node 和 node_modules文件夹</span><br><span class="line">              进入 /usr/local/include 删除所有 node 和 node_modules 文件夹</span><br><span class="line">              进入 /usr/local/bin 删除 node 的可执行文件</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">### Java</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">##### JAR包启动失败</span><br><span class="line">&gt; no main manifest attribute</span><br><span class="line"></span><br><span class="line">pom.xml中少了如下配置</span><br><span class="line"></span><br></pre></td></tr></table></figure>
 <build>
     <plugins>
         <plugin>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-maven-plugin</artifactId>
             <configuration>
                 <executable>true</executable>
             </configuration>
         </plugin>
     </plugins>
 </build>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">重新打包，放到服务器上，启动OK</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#####  mysql驱动包 版本太高了</span><br><span class="line"></span><br><span class="line">&gt;Unsatisfied dependency expressed through bean property &#x27;sqlSessionFactory&#x27;;</span><br><span class="line">&gt;Unsatisfied dependency expressed through bean property &#x27;sqlSessionFactory&#x27;; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#x27;sqlSessionFactory&#x27; defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method &#x27;sqlSessionFactory&#x27; parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#x27;dataSource&#x27; defined in class path resource [com/baomidou/dynamic/datasource/spring/boot/autoconfigure/DynamicDataSourceAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:mysql://47.99.216.41:3306/toy_bricks?useUnicode=true&amp;useNewIO=true&amp;characterEncoding=UTF-8&amp;serverTimezone=Hongkong&amp;zeroDateTimeBehavior=convertToNull</span><br><span class="line">&gt;at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]</span><br><span class="line"></span><br><span class="line">linux服务器mysql 5.7 不支持 8.0.25</span><br><span class="line"></span><br></pre></td></tr></table></figure>
     <dependency>
         <groupId>mysql</groupId>
         <artifactId>mysql-connector-java</artifactId>
         <version>5.1.29</version>
     </dependency>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">##### 虚拟内存溢出</span><br><span class="line"></span><br><span class="line">在VM options中添加</span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
</ol>
<p>-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xms1024m -Xmx1024m -Xmn256m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"></span><br></pre></td></tr></table></figure>
<p>-XX:MetaspaceSize=128m (元空间默认大小)<br>-XX:MaxMetaspaceSize=128m (元空间最大大小)<br>-Xms1024m (堆最大大小)<br>-Xmx1024m (堆默认大小)<br>-Xmn256m (新生代大小)<br>-Xss256k (棧最大深度大小)<br>-XX:SurvivorRatio=8 (新生代分区比例 8:2)<br>-XX:+UseConcMarkSweepGC (指定使用的垃圾收集器，这里使用CMS收集器)<br>-XX:+PrintGCDetails (打印详细的GC日志)</p>
<p>知识点：<br>JDK8之后把-XX:PermSize 和 -XX:MaxPermGen移除了，取而代之的是<br>-XX:MetaspaceSize=128m (元空间默认大小)<br>-XX:MaxMetaspaceSize=128m (元空间最大大小)<br>JDK 8开始把类的元数据放到本地化的堆内存(native heap)中，这一块区域就叫Metaspace，中文名叫元空间</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">##### 数据库链接失败</span><br><span class="line"></span><br><span class="line">&gt;  The last packet sent successfully to the server was 0 milliseconds ago. </span><br><span class="line"></span><br><span class="line">1. 修改链接</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>url: jdbc:mysql://47.99.216.41:3306/toy_bricks?useUnicode=true&amp;useNewIO=true&amp;characterEncoding=UTF-8&amp;serverTimezone=Hongkong&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false&amp;useLegacyDatetimeCode=false</p>
<pre><code>
2. 由于数据库回收了连接，而系统的缓冲池不知道，继续使用被回收的连接所致的，参考：https://blog.csdn.net/shiqidide/article/details/7642531



##### redis链接失败

&gt; Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command &#39;CONFIG SET protected-mode no&#39; from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to &#39;no&#39;, and then restarting the server. 3) If you started the server manually just for testing, restart it with the &#39;--protected-mode no&#39; option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.






























</code></pre>
<div id="paginator"></div></div><div id="post-footer"><hr><a href="/vcb/2021/09/22/Git/">← Prev Git</a><span style="color: #fe2"> | </span><a href="/vcb/2021/09/12/DeBian/">DeBian Next →</a><hr></div><div id="bottom-btn"><a id="to-index" href="#post-index" title="index">≡</a><a id="to-top" href="#post-title" title="to top">∧</a></div><div id="Valine"></div><script>new Valine({
 el: '#Valine'
 , appId: ''
 , appKey: ''
 , placeholder: '此条评论委托企鹅物流发送'
})</script></div></article><aside><div id="about"><a href="/vcb/" id="logo"><img src="https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png" alt="Logo"></a><h1 id="Dr"><a href="/"> Dr.VanKa</a></h1><section id="total"><a id="total-archives" href="/vcb/archives"><span class="total-title">Archives Total:</span><span class="total-number">12</span></a><div id="total-tags"><span class="total-title">Tags:</span><span class="total-number">13</span></div><div id="total-categories"><span class="total-title">Categories:</span><span class="total-number">1</span></div></section></div><div id="aside-block"><h1>INDEX</h1><div id="post-index"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Linux"><span class="toc-number">1.</span> <span class="toc-text">Linux</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%91%BD%E4%BB%A4%E7%AC%A6"><span class="toc-number">1.1.</span> <span class="toc-text">命令符</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#linux-%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E7%AC%A6"><span class="toc-number">1.1.0.0.1.</span> <span class="toc-text">linux 常用命令符</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E9%9D%9E%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E7%AC%A6"><span class="toc-number">1.1.0.0.2.</span> <span class="toc-text">非常用命令符</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C"><span class="toc-number">1.1.0.0.3.</span> <span class="toc-text">文件操作</span></a><ol class="toc-child"><li class="toc-item toc-level-6"><a class="toc-link" href="#%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6%E5%91%BD%E4%BB%A4"><span class="toc-number">1.1.0.0.3.1.</span> <span class="toc-text">删除文件命令</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E6%96%87%E4%BB%B6%E5%A4%B9%E5%91%BD%E4%BB%A4"><span class="toc-number">1.1.0.0.3.2.</span> <span class="toc-text">添加文件夹命令</span></a></li><li class="toc-item toc-level-6"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E6%96%87%E4%BB%B6%E5%91%BD%E4%BB%A4"><span class="toc-number">1.1.0.0.3.3.</span> <span class="toc-text">创建文件命令</span></a></li></ol></li><li class="toc-item toc-level-5"><a class="toc-link" href="#vim"><span class="toc-number">1.1.0.0.4.</span> <span class="toc-text">vim</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%85%B3%E6%9C%BA%E9%87%8D%E5%90%AF"><span class="toc-number">1.1.0.0.5.</span> <span class="toc-text">关机重启</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%9F%A5%E7%9C%8B%E5%86%85%E5%AD%98"><span class="toc-number">1.1.0.0.6.</span> <span class="toc-text">查看内存</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8D%87%E7%BA%A7%E5%86%85%E6%A0%B8"><span class="toc-number">1.1.0.1.</span> <span class="toc-text">升级内核</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%94%99%E8%AF%AF"><span class="toc-number">1.1.0.2.</span> <span class="toc-text">错误</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%98%B2%E7%81%AB%E5%A2%99"><span class="toc-number">1.2.</span> <span class="toc-text">防火墙</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#mysql"><span class="toc-number">1.2.1.</span> <span class="toc-text">mysql</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85"><span class="toc-number">1.2.1.1.</span> <span class="toc-text">安装</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#centos8"><span class="toc-number">1.2.1.1.1.</span> <span class="toc-text">centos8</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#centos-7"><span class="toc-number">1.2.1.1.2.</span> <span class="toc-text">centos 7</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8D%B8%E8%BD%BD"><span class="toc-number">1.2.1.2.</span> <span class="toc-text">卸载</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81"><span class="toc-number">1.2.1.2.1.</span> <span class="toc-text">修改密码</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E5%AF%BC%E5%85%A5"><span class="toc-number">1.2.1.3.</span> <span class="toc-text">数据导入</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%94%99%E8%AF%AF-1"><span class="toc-number">1.2.1.4.</span> <span class="toc-text">错误</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E5%A4%B1%E8%B4%A5"><span class="toc-number">1.2.1.4.1.</span> <span class="toc-text">远程连接失败</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#ip%E8%A2%AB%E5%B1%8F%E8%94%BD"><span class="toc-number">1.2.1.4.2.</span> <span class="toc-text">ip被屏蔽</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E9%98%B2%E7%81%AB%E5%A2%99%E9%97%AE%E9%A2%98"><span class="toc-number">1.2.1.4.3.</span> <span class="toc-text">防火墙问题</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E6%97%B6%E6%8A%A5%E9%94%99%EF%BC%9A%E6%B2%A1%E6%9C%89%E5%8C%85mysql-server%E5%8F%AF%E7%94%A8"><span class="toc-number">1.2.1.4.4.</span> <span class="toc-text">安装时报错：没有包mysql-server可用</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AE%E8%BF%9C%E7%A8%8B%E6%97%B6%E6%8A%A5%E9%94%99"><span class="toc-number">1.2.1.4.5.</span> <span class="toc-text">设置远程时报错</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%99%BB%E5%BD%95%E5%A4%B1%E8%B4%A5"><span class="toc-number">1.2.1.4.6.</span> <span class="toc-text">登录失败</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81%E5%A4%B1%E8%B4%A5"><span class="toc-number">1.2.1.4.7.</span> <span class="toc-text">修改密码失败</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Jdk"><span class="toc-number">1.3.</span> <span class="toc-text">Jdk</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%AE%89%E8%A3%85"><span class="toc-number">1.3.0.0.1.</span> <span class="toc-text">命令行安装</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E5%AE%89%E8%A3%85"><span class="toc-number">1.3.0.0.2.</span> <span class="toc-text">手动安装</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%93%8D%E4%BD%9C"><span class="toc-number">1.3.0.1.</span> <span class="toc-text">操作</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%9F%A5%E8%AF%A2JDK%E8%B7%AF%E5%BE%84"><span class="toc-number">1.3.0.1.1.</span> <span class="toc-text">查询JDK路径</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="toc-number">1.3.0.1.2.</span> <span class="toc-text">配置环境变量</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%94%99%E8%AF%AF-2"><span class="toc-number">1.3.0.2.</span> <span class="toc-text">错误</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#jdk%E4%B8%8B%E8%BD%BD%E9%94%99%E8%AF%AF%E4%BA%86"><span class="toc-number">1.3.0.2.1.</span> <span class="toc-text">jdk下载错误了</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Tomcat"><span class="toc-number">1.4.</span> <span class="toc-text">Tomcat</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Redis-%E5%AE%89%E8%A3%85"><span class="toc-number">1.5.</span> <span class="toc-text">Redis 安装</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-1"><span class="toc-number">1.5.0.1.</span> <span class="toc-text">安装</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%85%A8%E7%BD%91%E7%BB%9C-%E5%AE%89%E8%A3%85"><span class="toc-number">1.5.0.1.1.</span> <span class="toc-text">全网络 安装</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E4%B8%8B%E8%BD%BD-%E5%AE%89%E8%A3%85"><span class="toc-number">1.5.0.1.2.</span> <span class="toc-text">手动下载 安装</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%94%99%E8%AF%AF-3"><span class="toc-number">1.5.0.2.</span> <span class="toc-text">错误</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%B5%8B%E8%AF%95%E9%94%99%E8%AF%AF"><span class="toc-number">1.5.0.2.1.</span> <span class="toc-text">测试错误</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Mean"><span class="toc-number">1.6.</span> <span class="toc-text">Mean</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Nacos"><span class="toc-number">1.6.1.</span> <span class="toc-text">Nacos</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-2"><span class="toc-number">1.6.1.1.</span> <span class="toc-text">安装</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%94%99%E8%AF%AF-4"><span class="toc-number">1.6.1.2.</span> <span class="toc-text">错误</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#Unable-to-start-web-server-nested-exception-is-org-springframework-boot-web-server-WebServerException-Unable-to-start-embedded-Tomcat"><span class="toc-number">1.6.1.2.1.</span> <span class="toc-text">Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8%E5%A4%B1%E8%B4%A5"><span class="toc-number">1.6.1.2.2.</span> <span class="toc-text">启动失败</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%B2%A1%E6%9C%89%E6%95%B0%E6%8D%AE%E6%BA%90%E8%AE%BE%E7%BD%AE"><span class="toc-number">1.6.1.2.3.</span> <span class="toc-text">没有数据源设置</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#nacos-Request-error-please-try-again-later"><span class="toc-number">1.6.1.2.4.</span> <span class="toc-text">nacos Request error, please try again later!</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8%E5%A4%B1%E8%B4%A5-JAVA-HOME-%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="toc-number">1.6.1.2.5.</span> <span class="toc-text">启动失败 JAVA_HOME 环境变量</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Nignx"><span class="toc-number">1.6.2.</span> <span class="toc-text">Nignx</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"><span class="toc-number">1.6.2.1.</span> <span class="toc-text">环境搭建</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E5%AE%89%E8%A3%85-1"><span class="toc-number">1.6.2.2.</span> <span class="toc-text">手动安装</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#yum%E5%AE%89%E8%A3%85%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%89"><span class="toc-number">1.6.2.3.</span> <span class="toc-text">yum安装（推荐）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%A4%9A%E4%B8%AA%E4%BA%8C%E7%BA%A7%E5%9F%9F%E5%90%8D%E5%88%86%E9%85%8D%E4%B8%8D%E5%90%8C%E8%B7%AF%E5%BE%84"><span class="toc-number">1.6.2.4.</span> <span class="toc-text">多个二级域名分配不同路径</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%94%99%E8%AF%AF-5"><span class="toc-number">1.6.2.5.</span> <span class="toc-text">错误</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#NodeJs"><span class="toc-number">1.6.3.</span> <span class="toc-text">NodeJs</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-v10-13"><span class="toc-number">1.6.3.1.</span> <span class="toc-text">安装 v10.13</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-3"><span class="toc-number">1.6.3.2.</span> <span class="toc-text">安装</span></a></li></ol></li></ol></li></ol></li></ol></div></div><footer><nobr><span class="text-title">©</span><span class="text-content">1970 to 2020</span></nobr><wbr><nobr><span class="text-title">ICP</span><span class="text-content">——备案号——</span></nobr><wbr><wbr><nobr>published with&nbsp;<a target="_blank" rel="noopener" href="http://hexo.io">Hexo&nbsp;</a></nobr><wbr><nobr>Theme&nbsp;<a target="_blank" rel="noopener" href="https://github.com/Yue-plus/hexo-theme-arknights">Arknight&nbsp;</a></nobr><wbr><nobr>by&nbsp;<a target="_blank" rel="noopener" href="https://github.com/Yue-plus">Yue_plus</a></nobr></footer></aside></main><canvas id="canvas-dust"></canvas><script src="/vcb/js/arknights.js"></script><script src="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/highlight.min.js"></script></body></html>